Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Text2text task on ipex #1054

Merged
merged 13 commits into from
Dec 17, 2024
Merged

Conversation

jiqing-feng
Copy link
Collaborator

@jiqing-feng jiqing-feng commented Dec 9, 2024

Add IPEXModelForSeq2SeqLM support, optimized by torch.compile. It forced attn_implementation="static" to be compatible with torch.compile.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@jiqing-feng jiqing-feng marked this pull request as ready for review December 9, 2024 09:23
@jiqing-feng
Copy link
Collaborator Author

Hi @echarlaix @IlyasMoutawwakil . Please review this PR, thanks! BTW, the failed tests are not related to my changes.

@@ -14,7 +14,7 @@ Optimum Intel can be used to load models from the [Hub](https://huggingface.co/m

## Loading

You can load your model and apply IPEX optimizations (apply torch.compile for non-generation tasks). For supported architectures like LLaMA, BERT and ViT, further optimizations will be applied by patching the model to use custom operators.
You can load your model and apply IPEX optimizations (apply torch.compile except text-generation tasks). For supported architectures like LLaMA, BERT and ViT, further optimizations will be applied by patching the model to use custom operators.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what you mean here, I see torch.compile being applied to text-generation task, why does it say "except text-generation tasks" here ?

Copy link
Collaborator Author

@jiqing-feng jiqing-feng Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we didn't apply torch.compile in text-generation task which means IPEXModelForCausalLM doesn't have torch.compile in init. And generation tasks are also excluded in IPEXModel.init when calling torch.compile

@jiqing-feng
Copy link
Collaborator Author

Hi @IlyasMoutawwakil . I have fixed your comments, please take the 2nd round review. Thanks!

Signed-off-by: jiqing-feng <[email protected]>
Signed-off-by: jiqing-feng <[email protected]>
Signed-off-by: jiqing-feng <[email protected]>
Signed-off-by: jiqing-feng <[email protected]>
Signed-off-by: jiqing-feng <[email protected]>
Signed-off-by: jiqing-feng <[email protected]>
@jiqing-feng
Copy link
Collaborator Author

Hi @IlyasMoutawwakil . It should be ready to merge, thanks!

@IlyasMoutawwakil IlyasMoutawwakil removed the request for review from echarlaix December 17, 2024 12:08
@IlyasMoutawwakil IlyasMoutawwakil merged commit a76be08 into huggingface:main Dec 17, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants